<?php
	$auth = Zend_Auth::getInstance();
	if ($auth->hasIdentity()) {
?>
		<span style="font-weight:bold; font-size:18px;">
		<?php echo 'Logged as <a href="'.$this->url(array('controller'=>'auth','action'=>'index')).'">'.$auth->getIdentity()->username.'</a>';?>
		</span>
<?php
	}
else
{	
?>
	<div id="loginButton" style="cursor: pointer; float:right">
		<a href="#loginbutton" onclick="slideLoginForm();">Se connecter</a>
	</div>
<?php
	$form = new Application_Form_LoginForm();
	$form->setAction($this->url(array('controller'=>'auth','action'=>'login')));
	echo "<div id='loginForm' >".$form."</div>";
?>
eturn-label").hide();
		retu
<script type="text/javascript">
$(function() {
	$( "#loginForm" ).dialog({
		modal:true,
		title: "Ximatik - Se connecter",
		autoOpen: false,
		show: "explode",
		hide: "explode"
	});

	$( "#loginButton" ).click(function() {
		$( "#loginForm" ).dialog( "open" );
		$("#return-element").hide();
		$("#rrn false;
	});
});
</script>
<?php 
}
?>